
package lanqiao;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

public class Q0502 {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(System.out));
		String[] words = br.readLine().split(" ");

		int n = Integer.parseInt(words[0]);
		int a = 0;
		int b = 0;
		for (int i = 0; i < n; i++) {
			int t = Integer.parseInt(br.readLine().split(" ")[0]);
			if (t >= 85) {
				a++;
				b++;
			} else if (t >= 60) {
				a++;
			}
		}
		System.out.printf("%.0f%%\n", a * 100.0 / n);
		System.out.printf("%.0f%%", b * 100.0 / n);
		wr.flush();
	}
}
